function Node = move_mesh_simple(Node,Element,VT,ring1,NodeFlag,monitor,iter)
% function Node = move_mesh_simple(Node,Element,VT,ring1,NodeFlag,monitor,iter)
% move the mesh according to the value of monitor, where
%
%  Node      the coordinates of mesh nodes
%  Element   the vertex list for each triangle element
%  monitor   the value of monitor function on each node
%  iter      the count of iteration for solving elliptic mm equation
%  VT        a sparse matrix to indicate the elements around for each node
%
%  We assume that the mesh is unstructed!!
%


% smooth the monitor for 3 times
nn = 1./sum(VT,2);
for k = 1:3
    monitorT = (monitor(Element(:,1)) + monitor(Element(:,2)) + monitor(Element(:,3)))/3;
    monitor = VT*monitorT.*nn;
end

% solve the moving mesh equation just use the GS-iteration simply:
%
%     -\nabla (monitor \nabla X) = 0
% 
%% this is another version for above
innerNode = find(NodeFlag == 0);  % Assume that only the inner Node need to be updated
norm = 1./(ring1*monitor);   %the norm should applied at last
for k = 1:iter
    Node(innerNode,1) = (ring1(innerNode,:)*(Node(:,1).*monitor)).*norm(innerNode);
    Node(innerNode,2) = (ring1(innerNode,:)*(Node(:,2).*monitor)).*norm(innerNode);
end